package com.dx.mes.service.brm.service;

import com.dx.common.table.ppt.*;
import com.dx.mes.common.dao.*;
import com.dx.mes.common.transcoder.util.AppContext;
import com.dx.mes.common.transcoder.util.JacksonUtil;
import com.dx.mes.common.transcoder.util.LogUtils;
import com.dx.mes.common.transcoder.util.Util;
import com.dx.mes.facade.brm.service.IFbpbisstockerService;
import com.dx.mes.facade.brm.tx.Fbpbissto.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

import static com.dx.mes.common.bean.def.GenericDef.*;


@Service("fbpbisstockerService")
@SuppressWarnings({"unchecked"})
public class FbpbisstockerService implements IFbpbisstockerService {
	private static final String TX_NAME = T_FBPBISSTK;
	private LogUtils logUtils;
	
	@Autowired
	private IBisStockerDao bisStockerDao;

	@Autowired
	private IRetStockerPtDao retStockerPtDao;
	
	@Autowired
	private IRetStockerStDao retStockerStDao;
	
	@Autowired
	private IRetStockerZnDao retStockerZnDao;
	
	@Autowired
	private IBisToolDao bisToolDao;

	public String subMainProc(String evt_no,String strInMsg) {
		AppContext.clear();
		AppContext.setCurrServiceName(FbpbisstockerService.class.getSimpleName());
		AppContext.setCurrEventNumber(evt_no);
		logUtils = new LogUtils(FbpbisstockerService.class);
		logUtils.info("[InTrx:" + strInMsg + "]");
		
		String outMsg = "";
		FbpbisstoO outTrx = new FbpbisstoO();

		outTrx.setTrx_id(TX_NAME);
		outTrx.setType_id(TRX_OUT);
		outTrx.setRtn_code(String.valueOf(RETURN_CODE_SET_ERROR));
		
		try {
			FbpbisstoI inTrx = JacksonUtil.fromJson(strInMsg, FbpbisstoI.class);
			char action_flg = inTrx.getAction_flg().charAt(0);
			switch (action_flg) {
			case ACTION_FLG_QUERY:
				queryByCondition(inTrx,outTrx);
				break;
			case ACTION_FLG_INQUIRE:
				queryByStockerId(inTrx, outTrx);
				break;
			case ACTION_FLG_ADD:
				addFnc(inTrx,outTrx);
				break;
			case ACTION_FLG_UPDATE:
				updateAllFnc(inTrx,outTrx);
				break;
			case ACTION_FLG_DELETE:
				deleteFnc(inTrx,outTrx);
				break;
			case ACTION_FLG_LIST_WHOLE:
				listAllFnc(outTrx);
				break;
			default:
				errActionFnc(outTrx);
			}
			if (RETURN_CODE_OK.equals(outTrx.getRtn_code())) {
				bisStockerDao.flushCurSession();
			} else {
				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
			}

		} catch (Exception ex) {
			outTrx.setRtn_code(RETURN_CODE_UNKNOWN);
			outTrx.setRtn_mesg(ex.toString());
			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
		} finally {
			outMsg = JacksonUtil.toJSONStr(outTrx);
			logUtils.info("[OutTrx:" + outMsg + "]");
		}
		return outMsg;
	}
	
	//根据主键查找stocker
		public void queryByCondition(FbpbisstoI inTrx,FbpbisstoO outTrx) {
			String stocker_id ="";
			FbpbisstoIA iary = null;
			if(inTrx.getIary() == null || inTrx.getIary().size()==0){
				
			}else{
				iary = inTrx.getIary().get(0);
				stocker_id = iary.getStocker_id();
			}
			/***
			 * stockerID
			 ***/
			String hql = "FROM Bis_stocker where 1=1 ";
			if (stocker_id != null && !stocker_id.equals(_SPACE)) {
				if (stocker_id.indexOf('*') == -1) {
					hql = hql + " and stocker_id='" + stocker_id + "'";
				} else {
					hql = hql + " and stocker_id like '" + stocker_id.replace('*', '%') + "'";
				}
			}
			
			List<Bis_stocker> bisStoList = bisStockerDao.find(hql);
			/*if(bisStoList==null ||bisStoList.isEmpty()){
				outTrx.setRtn_code(E_FBPBISSTO_NOT_FOUND_RECORDER + "");
				outTrx.setRtn_code("Not found This stocker["+bisStoList+"]");
				return;
			}*/
			List<FbpbisstoOA> oaryList = new ArrayList<FbpbisstoOA>();
			for (Bis_stocker bis_stocker : bisStoList) {
				FbpbisstoOA oary = new FbpbisstoOA();
				oary.setStocker_id(bis_stocker.getStocker_id());
				oary.setStocker_dsc(bis_stocker.getStocker_dsc());
				oary.setStocker_typ(bis_stocker.getStocker_typ());
				oary.setTotal_shelf_cnt(bis_stocker.getTotal_shelf_cnt());
				oary.setUnq_seq_id(bis_stocker.getUnq_seq_id());
				oary.setBay_id(bis_stocker.getBay_id());
				oary.setFloor_code(bis_stocker.getFloor_code());
				oaryList.add(oary);
			}
			outTrx.setRtn_code(RETURN_CODE_OK);
			outTrx.setRtn_mesg(RETURN_MESG_OK);
			outTrx.setOary(oaryList);
			outTrx.setTbl_cnt(oaryList.size());
		}

		//根据stocker_id查询ret_stocker_pt表
		private void queryByStockerId(FbpbisstoI inTrx, FbpbisstoO outTrx) {
			FbpbisstoIA iary = inTrx.getIary().get(0);
			Bis_stocker bis_stocker = bisStockerDao.get(iary.getStocker_id());
			List<FbpbisstoOA> oaryList = new ArrayList<FbpbisstoOA>();
			List<FbpbisstoOB> oaryBList = new ArrayList<FbpbisstoOB>();
			
			FbpbisstoOA oary = new FbpbisstoOA();
			oary.setBay_id(bis_stocker.getBay_id());
			oary.setFloor_code(bis_stocker.getFloor_code());
			oary.setStocker_dsc(bis_stocker.getStocker_dsc());
			oary.setStocker_id(bis_stocker.getStocker_id());
			oary.setStocker_typ(bis_stocker.getStocker_typ());
			oary.setTotal_shelf_cnt(bis_stocker.getTotal_shelf_cnt());
			oary.setUnq_seq_id(bis_stocker.getUnq_seq_id());
			oaryList.add(oary);
			
			String hql = "FROM Ret_stocker_pt where 1=1 ";
			if (iary.getStocker_id() != null) {
				hql = hql + " and stocker_id_fk='" + iary.getStocker_id() + "'";
			}
			List<Ret_stocker_pt> bisStockerPtList = retStockerPtDao.find(hql);
			for(Ret_stocker_pt stocker_pt : bisStockerPtList){
				FbpbisstoOB oaryB = new FbpbisstoOB();
				oaryB.setStocker_id_fk(stocker_pt.getId().getStocker_id_fk());
				oaryB.setPort_id(stocker_pt.getId().getPort_id());
				oaryB.setPort_stat(stocker_pt.getPort_stat());
				oaryB.setPort_usage(stocker_pt.getPort_usage());
				oaryB.setUnq_seq_id(stocker_pt.getUnq_seq_id());
				oaryB.setXfr_id(stocker_pt.getXfr_id());
				oaryBList.add(oaryB);
			}
			
			outTrx.setRtn_code(RETURN_CODE_OK);
			outTrx.setRtn_mesg(RETURN_MESG_OK);
			outTrx.setOary(oaryList);
			outTrx.setOaryB(oaryBList);
			outTrx.setTbl_cnt(oaryList.size());
			outTrx.setTbl_cnt_B(oaryBList.size());
		}
		
	//新增bis_stocker,ret_stocker_pt,ret_stocker_st(硬编码)
	//1.stocker新增，port，zone新增
	public void addFnc(FbpbisstoI inTrx,FbpbisstoO outTrx) {
		String evtUsr = inTrx.getEvt_usr();
		Timestamp current_timestamp = Util.getCurrentTimestamp();
		if(inTrx.getIary().size() > 0){
		FbpbisstoIA iary = inTrx.getIary().get(0);
		String stocker_id = iary.getStocker_id();
			Bis_stocker queryBisSto = bisStockerDao.get(stocker_id);
			if (queryBisSto != null) {
				outTrx.setRtn_code(E_FBPBISSTO_ALREADY_EXIST + "");
				outTrx.setRtn_code("This stocker["+queryBisSto+"] has already exsits");
				return;
			}else{
				/**
				 * Stocker Basic Table
				 */
				Bis_stocker bis_stocker = new Bis_stocker();
				bis_stocker.setBay_id(iary.getBay_id());
				bis_stocker.setEvt_usr(evtUsr);
				bis_stocker.setEvt_timestamp(current_timestamp);
				bis_stocker.setFloor_code(iary.getFloor_code());
				//后台验证数字
				bis_stocker.setTotal_shelf_cnt(iary.getTotal_shelf_cnt());
				bis_stocker.setStocker_id(stocker_id);
				bis_stocker.setStocker_typ(iary.getStocker_typ());
				bis_stocker.setStocker_dsc(iary.getStocker_dsc());
				//bis_stocker.setUnq_seq_id(iary.getUnq_seq_id());
				bisStockerDao.save(bis_stocker);
				/**
				 * Stocker State Table
				 */
				Integer k=0;
				Ret_stocker_st ret_stocker_st = new Ret_stocker_st();
				ret_stocker_st.setStocker_id_fk(stocker_id);
				ret_stocker_st.setStocker_stat(STOCKER_STAT_DOWN);
				ret_stocker_st.setStocker_sub_stat("4000");
				ret_stocker_st.setStocker_ctrl_mode(_SPACE);
				ret_stocker_st.setPv_stocker_stat(_SPACE);
				ret_stocker_st.setPv_stocker_sub_stat(_SPACE);
				ret_stocker_st.setClm_usr(inTrx.getEvt_usr());
				ret_stocker_st.setClm_timestamp(current_timestamp);
				ret_stocker_st.setPv_clm_usr(_SPACE);
				ret_stocker_st.setPv_clm_timestamp(current_timestamp);
				ret_stocker_st.setKeep_time(k);
				ret_stocker_st.setStocker_note(_SPACE);
				ret_stocker_st.setLst_xfr_timestamp(current_timestamp);
				ret_stocker_st.setStocker_threshold(k);
				ret_stocker_st.setStocker_clean_time(k);
				retStockerStDao.save(ret_stocker_st);
				
				/**
				 * add bis_tool 
				 */
				Bis_tool bis_tool = bisToolDao.get(stocker_id);
				if(bis_tool != null){
					outTrx.setRtn_code(E_FBPBISSTO_ALREADY_EXIST + "");
					outTrx.setRtn_code("This stocker["+queryBisSto+"] has already exsits in bis_tool");
					return;
				}else{
					bis_tool = new Bis_tool();
					bis_tool.setTool_id(stocker_id);
					bis_tool.setTool_cate(TOOL_CATE_STOC);
					bis_tool.setTool_dsc(iary.getStocker_dsc());
					bis_tool.setBay_id(iary.getBay_id());
					bis_tool.setEvt_usr(inTrx.getEvt_usr());
					bis_tool.setEvt_timestamp(current_timestamp);
					bisToolDao.save(bis_tool);
				}
				
				List<FbpbisstoOA> oary = new ArrayList<FbpbisstoOA>();
				FbpbisstoOA oarya = new FbpbisstoOA();
				oarya.setBay_id(bis_stocker.getBay_id());
				oarya.setFloor_code(bis_stocker.getFloor_code());
				oarya.setStocker_dsc(bis_stocker.getStocker_dsc());
				oarya.setStocker_id(bis_stocker.getStocker_id());
				oarya.setStocker_typ(bis_stocker.getStocker_typ());
				oarya.setTotal_shelf_cnt(bis_stocker.getTotal_shelf_cnt());
				oarya.setUnq_seq_id(bis_stocker.getUnq_seq_id());
				oary.add(oarya);
				outTrx.setOary(oary);
			}
		}
		/**
		 * Stocker Port Table
		 */
		//为空则不加，
		List<FbpbisstoIB> iaryBList = inTrx.getIaryB();
		if(iaryBList.size() > 0){
			List<FbpbisstoOB> oaryB = new ArrayList<FbpbisstoOB>();
			for(FbpbisstoIB iaryB : iaryBList){
				Ret_stocker_pt ret_stocker_pt = new Ret_stocker_pt();
				Ret_stocker_ptId id = new Ret_stocker_ptId();
				id.setStocker_id_fk(iaryB.getStocker_id_fk());
				id.setPort_id(iaryB.getPort_id());
				//存在则更新，不存在则插入
				Ret_stocker_pt retStockerPt = retStockerPtDao.get(id);
				if (retStockerPt != null) {
					retStockerPt.setId(id);
					retStockerPt.setPort_stat(_SPACE);
					retStockerPt.setPort_usage(iaryB.getPort_usage());
					retStockerPt.setXfr_id(iaryB.getXfr_id());
					retStockerPt.setEvt_usr(inTrx.getEvt_usr());
					retStockerPt.setEvt_timestamp(current_timestamp);
					retStockerPtDao.update(retStockerPt);
				}else{
					ret_stocker_pt.setId(id);
					ret_stocker_pt.setPort_stat(_SPACE);
					ret_stocker_pt.setPort_usage(iaryB.getPort_usage());
					ret_stocker_pt.setXfr_id(iaryB.getXfr_id());
					ret_stocker_pt.setEvt_usr(inTrx.getEvt_usr());
					ret_stocker_pt.setEvt_timestamp(current_timestamp);
					retStockerPtDao.save(ret_stocker_pt);
				}
				FbpbisstoOB oaryb = new FbpbisstoOB();
				oaryb.setStocker_id_fk(iaryB.getStocker_id_fk());
				oaryb.setPort_id(iaryB.getPort_id());
				oaryb.setPort_stat(iaryB.getPort_stat());
				oaryb.setPort_usage(iaryB.getPort_usage());
				oaryb.setUnq_seq_id(iaryB.getUnq_seq_id());
				oaryb.setXfr_id(iaryB.getXfr_id());
				oaryB.add(oaryb);
			}
			outTrx.setOaryB(oaryB);
		}
		
		outTrx.setRtn_code(RETURN_CODE_OK);
		outTrx.setRtn_mesg(RETURN_MESG_OK);

	}
	
	//3.stocker更新+port,zone新增或修改
	public void updateAllFnc(FbpbisstoI inTrx,FbpbisstoO outTrx){
			Timestamp current_timestamp = Util.getCurrentTimestamp();
			FbpbisstoIA iary = inTrx.getIary().get(0);
			List<FbpbisstoIB> iaryBList = inTrx.getIaryB();
			String stocker_id = iary.getStocker_id();
			Bis_stocker bis_stocker = bisStockerDao.get(stocker_id);
			if (bis_stocker == null) {
				outTrx.setRtn_code(E_FBPBISSTO_NOT_FOUND_RECORDER + "");
				outTrx.setRtn_code("Not found This stocker["+stocker_id+"]");
				return;
			}
			if (iary.getStocker_id() != null) {
				bis_stocker.setStocker_id(stocker_id);
			}
			if (iary.getStocker_dsc() != null) {
				bis_stocker.setStocker_dsc(iary.getStocker_dsc());
			}
			if (iary.getBay_id() != null) {
				bis_stocker.setBay_id(iary.getBay_id());
			}
			if (iary.getTotal_shelf_cnt() != null) {
				bis_stocker.setTotal_shelf_cnt(iary.getTotal_shelf_cnt());
			}
			if (iary.getFloor_code() != null) {
				bis_stocker.setFloor_code(iary.getFloor_code());
			}
			if (iary.getStocker_typ() != null) {
				bis_stocker.setStocker_typ(iary.getStocker_typ());
			}
			bis_stocker.setEvt_usr(inTrx.getEvt_usr());
			bis_stocker.setEvt_timestamp(current_timestamp);
			bisStockerDao.update(bis_stocker);
			
			/**
			 * update Bis_tool
			 */
			Bis_tool bis_tool = bisToolDao.get(stocker_id);
			if(bis_tool == null){
				outTrx.setRtn_code(E_FBPBISSTO_NOT_FOUND_RECORDER + "");
				outTrx.setRtn_code("Not Found this stocker["+stocker_id+"],please check!");
				return;
			}else{
				bis_tool.setTool_cate(TOOL_CATE_STOC);
				bis_tool.setTool_dsc(iary.getStocker_dsc());
				bis_tool.setBay_id(iary.getBay_id());
				bis_tool.setEvt_usr(inTrx.getEvt_usr());
				bis_tool.setEvt_timestamp(current_timestamp);
				bisToolDao.update(bis_tool);
			}
		
		//删除多余的port 
		String hql = "FROM Ret_stocker_pt where stocker_id_fk ='"
						+ stocker_id + "'";
		//数据库里的数据
		List<Ret_stocker_pt> ret_stocker_pts= retStockerPtDao.find(hql);
		if(!ret_stocker_pts.isEmpty()){
			//port
			for (int i = 0;i < ret_stocker_pts.size(); i++) {
				Ret_stocker_pt ret_stocker_pt = ret_stocker_pts.get(i);
				if (iaryBList.isEmpty()) {
					retStockerPtDao.delete(ret_stocker_pt);
				}else{
					for(int j = 0; j < iaryBList.size(); j++){
						if(ret_stocker_pt.getId().getStocker_id_fk().trim().equals(iaryBList.get(j).getStocker_id_fk().trim())
								&& ret_stocker_pt.getId().getPort_id().trim().equals(iaryBList.get(j).getStocker_id_fk().trim())){
							break;
						}else{
							retStockerPtDao.delete(ret_stocker_pt);
						}
					}
				}
			}
		}
		
			List<FbpbisstoOB> oaryB = new ArrayList<FbpbisstoOB>();
			for(FbpbisstoIB iaryB : iaryBList){
				Ret_stocker_pt ret_stocker_pt = new Ret_stocker_pt();
				Ret_stocker_ptId id = new Ret_stocker_ptId();
				id.setStocker_id_fk(iaryB.getStocker_id_fk());
				id.setPort_id(iaryB.getPort_id());
				//存在则更新，不存在则插入
				Ret_stocker_pt retStockerPt = retStockerPtDao.get(id);
				if (retStockerPt != null) {
					retStockerPt.setId(id);
					retStockerPt.setPort_stat(_SPACE);
					retStockerPt.setPort_usage(iaryB.getPort_usage());
					retStockerPt.setXfr_id(iaryB.getXfr_id());
					retStockerPt.setEvt_usr(inTrx.getEvt_usr());
					retStockerPt.setEvt_timestamp(current_timestamp);
					retStockerPtDao.update(retStockerPt);
				}else{
					ret_stocker_pt.setId(id);
					ret_stocker_pt.setPort_stat(_SPACE);
					ret_stocker_pt.setPort_usage(iaryB.getPort_usage());
					ret_stocker_pt.setXfr_id(iaryB.getXfr_id());
					ret_stocker_pt.setEvt_usr(inTrx.getEvt_usr());
					ret_stocker_pt.setEvt_timestamp(current_timestamp);
					retStockerPtDao.save(ret_stocker_pt);
				}
				FbpbisstoOB oaryb = new FbpbisstoOB();
				oaryb.setStocker_id_fk(iaryB.getStocker_id_fk());
				oaryb.setPort_id(iaryB.getPort_id());
				oaryb.setPort_stat(iaryB.getPort_stat());
				oaryb.setPort_usage(iaryB.getPort_usage());
				oaryb.setUnq_seq_id(iaryB.getUnq_seq_id());
				oaryb.setXfr_id(iaryB.getXfr_id());
				oaryB.add(oaryb);
			}

			List<FbpbisstoOA> oary = new ArrayList<FbpbisstoOA>();
			FbpbisstoOA oarya = new FbpbisstoOA();
			oarya.setBay_id(bis_stocker.getBay_id());
			oarya.setFloor_code(bis_stocker.getFloor_code());
			oarya.setStocker_dsc(bis_stocker.getStocker_dsc());
			oarya.setStocker_id(bis_stocker.getStocker_id());
			oarya.setStocker_typ(bis_stocker.getStocker_typ());
			oarya.setTotal_shelf_cnt(bis_stocker.getTotal_shelf_cnt());
			oarya.setUnq_seq_id(bis_stocker.getUnq_seq_id());
			oary.add(oarya);
			outTrx.setOary(oary);
			outTrx.setOaryB(oaryB);
		
		outTrx.setRtn_code(RETURN_CODE_OK);
		outTrx.setRtn_mesg(RETURN_MESG_OK);
		return;
	}
	
	//删除stocker信息
	public void deleteFnc(FbpbisstoI inTrx,FbpbisstoO outTrx) {
		if(inTrx.getIary()!=null){
			FbpbisstoIA iary = inTrx.getIary().get(0);
			String stocker_id = iary.getStocker_id();
			Bis_stocker bis_stocker = bisStockerDao.get(stocker_id);
			if (bis_stocker == null) {
				outTrx.setRtn_code(E_FBPBISSTO_NOT_FOUND_RECORDER + "");
				outTrx.setRtn_code("not found stocker_id[" + bis_stocker + "]");
				return;
			}
			bisStockerDao.delete(bis_stocker);
			/**
			 * delete tool stat info
			 */
			Ret_stocker_st ret_stocker_st = retStockerStDao.get(stocker_id);
			if(ret_stocker_st != null){
				retStockerStDao.delete(ret_stocker_st);
			}
			/**
			 * delete port info
			 */
			String hql_port = "FROM Ret_stocker_pt where stocker_id_fk ='" + iary.getStocker_id() + "'";
			List<Ret_stocker_pt> retStockerPtList = retStockerPtDao.find(hql_port);
			if (retStockerPtList != null) {
				for (Ret_stocker_pt ret_stocker_pt : retStockerPtList) {
					retStockerPtDao.delete(ret_stocker_pt);
				}
			}
			/**
			 * delete Bis_tool
			 */
			Bis_tool bis_tool = bisToolDao.get(stocker_id);
			if (bis_tool == null) {
				outTrx.setRtn_code(E_FBPBISSTO_NOT_FOUND_RECORDER + "");
				outTrx.setRtn_code("Not Found this stocker[" + stocker_id + "],please check!");
				return;
			} else {
				bisToolDao.delete(bis_tool);
			}
			//delete zone info
	//		String hql_zone = "FROM Ret_stocker_zn where stocker_id_fk ='"+iary.getStocker_id() + "'";
	//		List<Ret_stocker_zn> ret_stocker_zns =retStockerZnDao.find(hql_zone);
	//		if(ret_stocker_zns !=null){
	//			for (Ret_stocker_zn ret_stocker_zn : ret_stocker_zns) {
	//				retStockerZnDao.delete(ret_stocker_zn);
	//			}
	//		}
	//		}
			/**
			 * delete port info by port_id and stocker_id_fk
			 */
			/*if(inTrx.getIaryB()!=null){
				FbpbisstoIB iaryB=inTrx.getIaryB().get(0);
				String port_id = iaryB.getPort_id();
				String hql_port = "FROM Ret_stocker_pt where stocker_id_fk ='"+ iaryB.getStocker_id_fk() + "'"
						+" and port_id= " + "'" + port_id + "'";
				List<Ret_stocker_pt> retStockerPtList = retStockerPtDao.find(hql_port);
				for(Ret_stocker_pt ret_stocker_pt : retStockerPtList){
					retStockerPtDao.delete(ret_stocker_pt);
				}
			}*/
		}
		outTrx.setRtn_code(RETURN_CODE_OK);
		outTrx.setRtn_mesg(RETURN_MESG_OK);
	}

	public void listAllFnc(FbpbisstoO outTrx) {
		List<FbpbisstoOA> oaryList = new ArrayList<FbpbisstoOA>();
		String hql = "FROM Bis_stocker where 1=1 ";
		List<Bis_stocker> bisStoList = bisStockerDao.find(hql);
		for (Bis_stocker bis_stocker : bisStoList) {
			FbpbisstoOA oary = new FbpbisstoOA();
			oary.setBay_id(bis_stocker.getBay_id());
			oary.setFloor_code(bis_stocker.getFloor_code());
			oary.setStocker_dsc(bis_stocker.getStocker_dsc());
			oary.setStocker_id(bis_stocker.getStocker_id());
			oary.setStocker_typ(bis_stocker.getStocker_typ());
			oary.setTotal_shelf_cnt(bis_stocker.getTotal_shelf_cnt());
			oaryList.add(oary);
		}
		outTrx.setOary(oaryList);
		outTrx.setTbl_cnt(oaryList.size());
		outTrx.setRtn_code(RETURN_CODE_OK);
		outTrx.setRtn_mesg(RETURN_MESG_OK);
	}

	public Bis_stocker getDataByKeyProc(String stocker_id) {
		Bis_stocker bis_stocker = bisStockerDao.get(stocker_id);
		return bis_stocker;
	}

	public void errActionFnc(FbpbisstoO outTrx) {
		outTrx.setRtn_code("0000009");
		outTrx.setRtn_mesg("Invalid Action_flg");
	}

}
